<style lang="less">
  @import './papermanager.less';
</style>
<template>
  <div class="">
    <paper-preview :data="data"></paper-preview>
    <Spin size="large" fix v-if="loading"></Spin>
  </div>

</template>
<script>
import paperPreview from '../../preview/paper-preview.vue'
import axios from 'axios'

export default {
  title: '试卷预览',
    data () {
        return {
          data: {},
          loading: false
        }
    },
    mounted () {
      // console.log('1111111111111111111111', this.$route.query)
      // this.getParer()
    },
    methods: {
      getParer (row) {
        this.loading = true
        axios.post('rs/logic/testdailinfo', {data: {testid: row.id}}).then(res => {
          if (res.data.code === 200) {
            this.data = {
              testinfo: res.data.testinfo,
              tests: [res.data.oneques, res.data.douques, res.data.judques]
            }
          }
        }).finally(() => {
          this.loading = false
        })
      }
    },
    beforeRouteEnter (to, from, next) {
      next(vm => {
        vm.getParer(to.params)
      })
    },
    components: {
        paperPreview
    },
};
</script>
